package com.yingluo.abacus.plantform.docs.app.example;

import com.yingluo.abacus.boot.core.common.props.SystemConfig;
import com.yingluo.abacus.plantform.docs.app.example.vo.props.MyProps;
import com.yingluo.abacus.plantform.docs.app.utils.DocsAppUtils;
import com.yingluo.abacus.plantform.utils.PlantformUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PropsController {

	private static final Logger logger = LoggerFactory.getLogger(PropsController.class);
	private final static String PATH= DocsAppUtils.MOUDLE_PATH+"/example/props";

	    @Autowired  
	    private MyProps myProps;
	    @Autowired
		SystemConfig config;
	    @Value("${yingluo.name}")
	    String name;
//	    @Value("${my.message}")
	    String messageCloud;
	    @RequestMapping(PlantformUtils.PROJECT_PATH +PATH)
	    public MyProps value() throws Exception{

			logger.debug("simpleProp: " + myProps.getSimpleProp());
			logger.debug("arrayProps: " + myProps.getArrayProps());
			logger.debug("listProp1: " + myProps.getListProp1());
			logger.debug("listProp2: " + myProps.getListProp2());
			logger.debug("mapProps: " + myProps.getMapProps());
			logger.debug("SwaggerPackage: " + config.getSwaggerPackage());
			logger.debug("name: " + name);
			logger.debug("messageCloud: " + messageCloud);
	        return myProps;
	    }
}
